import 'package:flutter_ncsjqz_getx/generated/json/base/json_convert_content.dart';
import 'package:flutter_ncsjqz_getx/model/group_details_entity.dart';

GroupDetailsEntity $GroupDetailsEntityFromJson(Map<String, dynamic> json) {
	final GroupDetailsEntity groupDetailsEntity = GroupDetailsEntity();
	final String? msg = jsonConvert.convert<String>(json['msg']);
	if (msg != null) {
		groupDetailsEntity.msg = msg;
	}
	final int? code = jsonConvert.convert<int>(json['code']);
	if (code != null) {
		groupDetailsEntity.code = code;
	}
	final GroupDetailsData? data = jsonConvert.convert<GroupDetailsData>(json['data']);
	if (data != null) {
		groupDetailsEntity.data = data;
	}
	return groupDetailsEntity;
}

Map<String, dynamic> $GroupDetailsEntityToJson(GroupDetailsEntity entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['msg'] = entity.msg;
	data['code'] = entity.code;
	data['data'] = entity.data?.toJson();
	return data;
}

GroupDetailsData $GroupDetailsDataFromJson(Map<String, dynamic> json) {
	final GroupDetailsData groupDetailsData = GroupDetailsData();
	final int? groupCount = jsonConvert.convert<int>(json['groupCount']);
	if (groupCount != null) {
		groupDetailsData.groupCount = groupCount;
	}
	final List<GroupDetailsDataUsers>? users = jsonConvert.convertListNotNull<GroupDetailsDataUsers>(json['users']);
	if (users != null) {
		groupDetailsData.users = users;
	}
	final bool? isDisturb = jsonConvert.convert<bool>(json['isDisturb']);
	if (isDisturb != null) {
		groupDetailsData.isDisturb = isDisturb;
	}
	final String? groupName = jsonConvert.convert<String>(json['groupName']);
	if (groupName != null) {
		groupDetailsData.groupName = groupName;
	}
	final String? groupId = jsonConvert.convert<String>(json['groupId']);
	if (groupId != null) {
		groupDetailsData.groupId = groupId;
	}
	final int? groupType = jsonConvert.convert<int>(json['groupType']);
	if (groupType != null) {
		groupDetailsData.groupType = groupType;
	}
	final bool? isReview = jsonConvert.convert<bool>(json['isReview']);
	if (isReview != null) {
		groupDetailsData.isReview = isReview;
	}
	final int? groupStatus = jsonConvert.convert<int>(json['groupStatus']);
	if (groupStatus != null) {
		groupDetailsData.groupStatus = groupStatus;
	}
	return groupDetailsData;
}

Map<String, dynamic> $GroupDetailsDataToJson(GroupDetailsData entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['groupCount'] = entity.groupCount;
	data['users'] =  entity.users?.map((v) => v.toJson()).toList();
	data['isDisturb'] = entity.isDisturb;
	data['groupName'] = entity.groupName;
	data['groupId'] = entity.groupId;
	data['groupType'] = entity.groupType;
	data['isReview'] = entity.isReview;
	data['groupStatus'] = entity.groupStatus;
	return data;
}

GroupDetailsDataUsers $GroupDetailsDataUsersFromJson(Map<String, dynamic> json) {
	final GroupDetailsDataUsers groupDetailsDataUsers = GroupDetailsDataUsers();
	final String? roomUserId = jsonConvert.convert<String>(json['roomUserId']);
	if (roomUserId != null) {
		groupDetailsDataUsers.roomUserId = roomUserId;
	}
	final int? userId = jsonConvert.convert<int>(json['userId']);
	if (userId != null) {
		groupDetailsDataUsers.userId = userId;
	}
	final String? ryUserId = jsonConvert.convert<String>(json['ryUserId']);
	if (ryUserId != null) {
		groupDetailsDataUsers.ryUserId = ryUserId;
	}
	final String? remarkName = jsonConvert.convert<String>(json['remarkName']);
	if (remarkName != null) {
		groupDetailsDataUsers.remarkName = remarkName;
	}
	final String? groupId = jsonConvert.convert<String>(json['groupId']);
	if (groupId != null) {
		groupDetailsDataUsers.groupId = groupId;
	}
	final bool? isDisturb = jsonConvert.convert<bool>(json['isDisturb']);
	if (isDisturb != null) {
		groupDetailsDataUsers.isDisturb = isDisturb;
	}
	final int? groupType = jsonConvert.convert<int>(json['groupType']);
	if (groupType != null) {
		groupDetailsDataUsers.groupType = groupType;
	}
	final String? picUrl = jsonConvert.convert<String>(json['picUrl']);
	if (picUrl != null) {
		groupDetailsDataUsers.picUrl = picUrl;
	}
	return groupDetailsDataUsers;
}

Map<String, dynamic> $GroupDetailsDataUsersToJson(GroupDetailsDataUsers entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['roomUserId'] = entity.roomUserId;
	data['userId'] = entity.userId;
	data['ryUserId'] = entity.ryUserId;
	data['remarkName'] = entity.remarkName;
	data['groupId'] = entity.groupId;
	data['isDisturb'] = entity.isDisturb;
	data['groupType'] = entity.groupType;
	data['picUrl'] = entity.picUrl;
	return data;
}